#include <iostream>

class A
{
public:
    A()
    {
        std::cout << "A construct..." << std::endl;
    }

    virtual ~A()
    {
        std::cout << "A destruct..." << std::endl;
    }

    virtual void action() = 0;
};

class B : public A
{
public:
    B()
    {
        std::cout << "B construct..." << std::endl;
    }

    ~B()
    {
        std::cout << "B destruct..." << std::endl;
    }

    void action()
    {
        std::cout << "B action..." << std::endl;
    }
};

int main()
{
    A *b = new B;

    b->action();

    delete b;

    return 0;
}